{% extends 'frontend/base/index.html' %}
{% block seo %}
    <title>首页</title>
    <meta name="keywords" content="hello,hello2,王大锤">
    <meta name="description" content="测试flask模板">
{% endblock %}
{% block position %}
    <section class="ng-navbar">
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <ol class="breadcrumb">
                        <li><a href="/">首页</a></li>
                    </ol>
                </div>
            </div>
        </div>
    </section>
{% endblock %}

{% block main %}
    <div class="col-xs-12 col-sm-9">
        {% for item in data %}
            <div class="main-item media">
                {% if data.thumbnail %}
                    <div class="media-left media-middle hidden-xs">
                        <a href="{{ url_for('frontend.frontend_post_details',title=item.title) }}">
                            <img src="http://img.guohongfu.top/20190829154149.jpg" alt="" class="media-object"
                                 style="height: 150px">
                        </a>
                    </div>
                {% endif %}
                <div class="media-body">
                    <h2><a href="{{ url_for('frontend.frontend_post_details',title=item.title) }}">{{ item.name }}</a>
                    </h2>
                    <span class="pull-left"><i class="iconfont">&#xe8eb;</i></span>
                    <ul class="list-inline">
                        {{ item.keywords|getTags|safe }}
                    </ul>
                    <a href="" class="hidden-lg">
                        <img src="http://img.guohongfu.top/20190829154149.jpg" alt="" class="media-object"
                             style="height: 150px">
                    </a>
                    <p>
                        {{ item.description }}
                    </p>
                </div>
                <div class="pull-left">
                    <ul class="list-inline">
                        <li style="line-height: 20px"><i class="iconfont">&#xe72c; </i>
                            发布于 {{ moment(item.create_time).fromNow(refresh=True) }}</li>
                        <li style="line-height: 20px"><i class="iconfont">&#xe632; </i><span>邱锦</span></li>
                        <li style="line-height: 20px"><i class="iconfont">&#xe605; </i><span><a
                                href="{{ url_for('frontend.frontend_post_list',title=item.category_id|getCategoryTitle) }}">{{ item.category_id|getCategoryName }}</a></span>
                        </li>
                    </ul>
                </div>
                <div class="pull-right"><a href="{{ url_for('frontend.frontend_post_details',title=item.title) }}"
                                           class="btn btn-info">阅读更多</a></div>
                <div class="clearfix"></div>
            </div>
        {% endfor %}
    </div>
{% endblock %}
{% block page %}
    <div class="col-xs-12 col-sm-9">
{#    {{ pg.page(result,"main.index") }}#}
    </div>
{% endblock %}

{% block script %}
    <script>
        var active = {{ title }};
        $('.' + active).addClass('active')
    </script>
{% endblock %}